/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved.
 */
package com.kaaction.modules.operate.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kaaction.common.service.TreeService;
import com.kaaction.common.utils.StringUtils;
import com.kaaction.modules.operate.entity.Material;
import com.kaaction.modules.operate.dao.MaterialDao;

/**
 * 类目Service
 * @author zengbiao
 * @version 2017-04-13
 */
@Service
@Transactional(readOnly = true)
public class MaterialService extends TreeService<MaterialDao, Material> {

	public Material get(String id) {
		return super.get(id);
	}
	
	public List<Material> findList(Material material) {
		if (StringUtils.isNotBlank(material.getParentIds())){
			material.setParentIds(","+material.getParentIds()+",");
		}
		return super.findList(material);
	}
	
	@Transactional(readOnly = false)
	public void save(Material material) {
		super.save(material);
	}
	
	@Transactional(readOnly = false)
	public void delete(Material material) {
		super.delete(material);
	}
	
}